package es.valma.VideoClub.intefaces.controllers;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import es.valma.VideoClub.base.VideoClubSvCliente;

public class SelectorWebController implements IWebController{

	@Override
	public String doProcess(HttpServletRequest request,
			HttpServletResponse response) {
		String rc="/index";
		 HttpSession sesion=request.getSession();
		 String nombre=request.getParameter("Nombre");
		 String operacion=request.getParameter("operacion");
		 String tipo=request.getParameter("Tipo");
	     VideoClubSvCliente clienteActual=(VideoClubSvCliente)sesion.getAttribute("clienteActual");
		if(clienteActual!=null){
			if(tipo!=null && tipo.equals("Series")){
				rc="/selectorSeries";
			}else{
				rc="/selectorPeliculas";
			}
			if(operacion!=null){
				try{
					int op=Integer.parseInt(operacion);
					switch(op){
						case 1:
							rc=rc+"/selector_frame1";
							break;
<<<<<<< .mine						case 2:
							rc="/selector_frame2";
							break;
=======						case 2:
							rc=rc+"/selector_frame2";
							break;
>>>>>>> .theirs						default:break;
					}
				}catch(Throwable e){	
				}
				
			}
			
		}else{
			rc="/index";
		}
		
		
		return rc;
	}

}
